//Camera.cpp
// compile with: /EHsc /LD
#include "Including.h"

using namespace std;

//move camera
GLfloat s_eye[] = {-8, -2, -45};
GLfloat s_at[] = {0, 0, 0};
GLfloat s_angle = 95.0;
GLfloat y_angle = 3.0;
float speed = 0.01f;
float rad;


namespace SDLFuncs
{
	///////////////////////////////
	/* Set Camera
	*/
	int MySDLFuncs::Camera(void *data)
	{
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

		//Setup Camera
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		gluPerspective(45, SCREEN_WIDTH/SCREEN_HEIGHT, 0.1, 500);
		
		
		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();
		
		//camera control
		s_at[0] = float(s_eye[0] + 100*cos(rad)); 
		s_at[2] = float(s_eye[2] + 100*sin(rad)); 
		s_at[1] = float(s_eye[1] + y_angle); 

		gluLookAt(s_eye[0],s_eye[1],s_eye[2],
              s_at[0],s_at[1],s_at[2],
              0.0f,1.0f,0.0f);

		//scene control
		//glPushMatrix();
		//glTranslatef(0.0, 0.0, translate_x -10);
		//glTranslatef(-translate_y, 0.0, 0.0);
		return 0;	
	}


}
